#include <stdio.h>
#include <stdlib.h>
namespace BaiDuStar
{
	int star_2012_1211_01()
	{
		int t,n,a,b,tmp,*r,*s;
		scanf("%d",&t);
		s = new int[t];
		for(int i=0;i<t;i++)
		{
			scanf("%d%d%d",&a,&b,&n);
			r = new int[n];
			r[0] = a;
			r[1] = b;
			for (int j =2; j<n ; j++)
			{
				tmp = r[j-2] + r[j-1];
				if(tmp>=10)
				{
					r[j] = tmp / 10;
					r[++j] = tmp % 10;
				}
				else r[j] = tmp;
			}
			s[i]=r[n-1];
		}
		for (int i = 0; i<t; i++)
			printf("Case #%d: %d\n",i+1, s[i]);
		return 0;
	}
}